﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using TaxiCaosSOAPService.Dominio;
using NHibernate;

namespace TaxiCaosSOAPService.Persistencia
{
    public class CatalogoDAO : BaseDAO<Catalogo, int>
    {
        public IList<Catalogo> ObtenerListaPorTipoCatalogo(string tipoCatalogo)
        {
            using (ISession sesion = NHibernateHelper.ObtenerSesion())
            {
                string sentenciaSQL = "from Catalogo c where c.TipoCatalogo = :tipoCatalogo";
                IQuery query = sesion.CreateQuery(sentenciaSQL);
                query.SetParameter("tipoCatalogo", tipoCatalogo);
                return query.List<Catalogo>(); ;
            }
        }
    }
}